﻿#ifndef QFPWIDGET_H
#define QFPWIDGET_H

#include "UIController/UIController.h"

#include "PlayConfig.h"

#include <QWidget>
#include <QToolButton>
#include <QStatusBar>
#include <QLabel>
#include <QResizeEvent>


#define LOCATION_OF_REAL_PATH Qt::UserRole + 1

QT_BEGIN_NAMESPACE
namespace Ui { class QtPotPlayer; }
QT_END_NAMESPACE

class QtPotPlayer : public QWidget
{
    Q_OBJECT

public:
    QtPotPlayer(QWidget *parent = nullptr);
    ~QtPotPlayer();
    
    WId WinId();
    void addWidget(int index, QWidget *w);
    void setCurrentIndex(int index);
    void setCurrentWidget(QWidget *w);
    QWidget *CurrentWidget(int index);
public slots:
    void EmitBtnPlayCtrl();
    void EmitBtnStop();
    void EmitBtnPrevious();
    void EmitBtnNext();
    void EmitBtnOpen();
    void EmitBtnPlayConfig();
    
protected slots: 
    void HidePlayList();
    
signals:
    void SigBtnPlayCtrlObj(QPushButton *obj);
    void SigBtnStopObj(QPushButton *obj);
    void SigBtnPreviousObj(QPushButton *obj);
    void SigBtnNextObj(QPushButton *obj);
    void SigBtnOpenObj(QPushButton *obj);
    void SigBtnPlayConfigObj(QPushButton *obj);
    
protected:
    bool eventFilter(QObject *obj, QEvent *event) override;
    
    
    void resizeEvent(QResizeEvent *e) override;
private:
    Ui::QtPotPlayer *ui;
    QToolButton *AddTab;
    PlayConfig  *PlayCtrl;
    UIController *Controller;
    
};
#endif // QFPWIDGET_H
